import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
// 全局导入面包屑与卡片模块
import MainBox from './pubom/MainBox.vue'
import './assets/fonts/iconfont.css'
import './assets/css/globle.css'
import axios from "axios"

import TableTree from 'vue-table-with-tree-grid'
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
    ///请求之前配置请求拦截器  每次请求 都需要那个token值来进行页面操作
    // axios.interceptors.request.use(config => {
    //     console.log(config);
    //     config.headers.Authorization = window.sessionStorage.getItem('token')
    //     return config
    // })
axios.interceptors.request.use(config => {
    // console.log(config);
    config.headers.Authorization = window.sessionStorage.getItem("token")
    return config
})
Vue.config.productionTip = false
Vue.prototype.$http = axios

Vue.component('MainBox', MainBox)
Vue.component('table-tree', TableTree)
new Vue({
    router,
    render: h => h(App)
}).$mount('#app')